<template>
  <div>
    <div class="stage-content" :class="{ 'stage-kio-content': bsinfo.tag === 1, 'stage-kis-content': bsinfo.tag === 2 }">
      <div class="step" :class="{ 'stage-kio-step': bsinfo.tag === 1, 'stage-kis-step': bsinfo.tag === 2 }">&gt;&gt; Stage{{ bsinfo.tag }} &lt;&lt;</div>
      <div class="stage1">
        <el-row :gutter="10" class="total" style="margin-left: 0; margin-right: 0;">
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
            <div class="stage-info-left">
              <div class="total-funds" :class="{ 'kio_total_funds': bsinfo.tag === 1, 'kis_total_funds': bsinfo.tag === 2 }">
                <p class="total-funds-title">
                  {{ bsinfo.tag == 1 ? "kio" : "kis" }}{{ $t('home.amounts') }}
                </p>
                <p class="total-funds-pool">{{ bsinfo.bonus }} USDT</p>
                <div class="time-content">
                  <div class="time">{{ bsinfo.endtime.h }}</div>
                  <div class="semicolon">:</div>
                  <div class="time">{{ bsinfo.endtime.m }}</div>
                  <div class="semicolon">:</div>
                  <div class="time">{{ bsinfo.endtime.s }}</div>
                </div>
                <el-button
                  :disabled="!bsinfo.isAllowGetBonus"
                  @click="$parent.$convert(bsinfo.tag == 1 ? 'kid' : 'kia', false,true)"
                  round
                  class="btn-get"
                  >{{ $t('home.button.get') }}</el-button
                >
              </div>
            </div>
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
            <el-row :gutter="10" class="totalFundsPoolTable">
              <el-col
                :xs="12"
                :sm="bsinfo.totalSupply2 ? 6 : 8"
                :md="bsinfo.totalSupply2 ? 6 : 8"
                :lg="bsinfo.totalSupply2 ? 6 : 8"
                :xl="bsinfo.totalSupply2 ? 6 : 8"
                class="stage-info-col"
              >
                <div class="flex">
                  <div class="item">
                    <div class="top">{{ bsinfo.depositTotal }}</div>
                    <div>{{ bsinfo.tag == 1 ? "Kid" : "kia" }}{{ $t('home.depositAmounts') }}</div>
                  </div>
                </div>
              </el-col>
              <!-- <el-col
                :xs="12"
                :sm="bsinfo.totalSupply2 ? 6 : 8"
                :md="bsinfo.totalSupply2 ? 6 : 8"
                :lg="bsinfo.totalSupply2 ? 6 : 8"
                :xl="bsinfo.totalSupply2 ? 6 : 8"
                class="stage-info-col"
              >
                <div class="flex">
                  <div class="item">
                    <div class="top">{{ bsinfo.totalSupply1 }}</div>
                    <div>{{ bsinfo.tag == 1 ? "kio" : "kis" }}{{ $t('home.digoutAmounts') }}</div>
                  </div>
                </div>
              </el-col> -->
              <el-col
                v-if="bsinfo.totalSupply2"
                :xs="12"
                :sm="bsinfo.totalSupply2 ? 6 : 8"
                :md="bsinfo.totalSupply2 ? 6 : 8"
                :lg="bsinfo.totalSupply2 ? 6 : 8"
                :xl="bsinfo.totalSupply2 ? 6 : 8"
                class="stage-info-col"
              >
                <div class="flex">
                  <div class="item">
                    <div class="top">{{ bsinfo.totalSupply2 }}</div>
                    <div>Kio{{ $t('home.digoutAmounts') }}</div>
                  </div>
                </div>
              </el-col>
              <el-col
                :xs="12"
                :sm="bsinfo.totalSupply2 ? 6 : 8"
                :md="bsinfo.totalSupply2 ? 6 : 8"
                :lg="bsinfo.totalSupply2 ? 6 : 8"
                :xl="bsinfo.totalSupply2 ? 6 : 8"
                class="stage-info-col"
              >
                <div class="flex">
                  <div class="item">
                    <div class="top">{{ bsinfo.exchangeTotal }}</div>
                    <div>{{ bsinfo.tag == 1 ? "Kio" : "kis" }}{{ $t('home.exchangeAmounts') }}</div>
                  </div>
                </div>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'stageInfo',
  props: {
    bsinfo: {
      type: Object,
      default(v) {
        v = v || {};
        v.endtime = v.endtime || { h: "", m: "", s: "", bonus: 0 };
        return v;
      },
    },
  },
  data() {
    return {
      aa: 1,
    };
  },
  mounted() {
    setInterval(() => {
      // this.exchangeTotalOfKio++;
      // this.oneEndtime=new Date(1598867303054);
      // debugger
    }, 5000);
  }
};
</script>

<style lang="scss" scoped>
  .stage-content {
    width: 100%;
    .step {
      width: 100%;
      height: 60px;
      line-height: 60px;
      text-align: center;
      font-size: 30px;
      font-weight: bold;
      color: #fff;
    }
    .stage1 {
      width: 100%;
      margin: 0 auto;
    }

    .total {
      display: flex;
      justify-content: center;
      align-items: center;
      .total-funds-title {
        padding-top: 69px;
        font-size: 18px;
        color: #fff;
      }

      .stage-info-left {
        display: flex;
        justify-content: flex-end;
      }
      .total-funds {
        padding-left: 50px;
        width: 500px;
        height: 400px;

        .total-funds-pool {
          font-size: 48px;
          font-weight: bold;
          padding-top: 25px;
        }

        .time-content {
          font-size: 36px;
          padding-top: 40px;
          font-weight: bold;
          color: #fff;

          .time {
            display: inline-block;
            width: 60px;
            height: 60px;
            line-height: 60px;
            text-align: center;
            border-radius: 6px;
          }

          .semicolon {
            text-align: center;
            height: 60px;
            line-height: 60px;
            display: inline-block;
            width: 30px;
          }
        }

        .btn-get {
          width: 240px;
          height: 54px;
          margin-top: 36px;
          // background-color: #FCBA46;
          // border: 1px solid #FCBA46;
          font-size: 16px;
          color: #fff;
          border-radius: 30px;
        }
      }

      .totalFundsPoolTable {
        height: auto;
        background: rgba(100, 58, 243, 0.8);
        border: 2px solid #8F60F9;
        border-radius: 10px;
        .stage-info-col {
          height: 100%;
        }
        .flex {
          display: flex;
          align-items: center;
          justify-content: center;
          height: 100%;
          padding-bottom: 10px;
        }
        .item {
          color: #fff;
          font-size: 14px;
          text-align: center;

          .top {
            padding: 20px 0 40px 0;
            font-size: 36px;
            font-weight: bold;
          }
        }
      }
    }
  }

  .stage-kio-step {
    background: linear-gradient(90deg, #7240F6, #8A57F9, #935BFB);
  }
  .stage-kis-step {
    background: linear-gradient(90deg, #FF8857, #FF9C69, #FF9358);
  }
  .stage-kio-content {
    background: url('../../assets/image/banner1@2x.png') no-repeat center bottom / 100% 400px;
    .total {
      .kio_total_funds {
        background: url('../../assets/image/kio_total_funds_bg.png') no-repeat center bottom / 500px 255px;
        .total-funds-pool {
          color: #ffce01;
          text-shadow: 0px 2px 9px rgba(100, 57, 243, 0.6);
        }
        .time-content {
          .time {
            background: rgba(100, 57, 243, .6);
          }
        }
        .btn-get {
          background-color: #FCBA46;
          border: 1px solid #FCBA46;
        }
      }
      .totalFundsPoolTable {
        background: rgba(100, 58, 243, 0.8);
        border: 2px solid #8F60F9;
      }
    }
  }
  .stage-kis-content {
    background: url('../../assets/image/banner2@2x.png') no-repeat center bottom / 100% 400px;
    .total {
      .kis_total_funds {
        background: url('../../assets/image/kis_total_funds_bg.png') no-repeat center bottom / 500px 255px;
        .total-funds-pool {
          color: #fff;
          text-shadow: 0px 2px 9px rgba(255, 97, 51, 0.81);
        }
        .time-content {
          .time {
            background: rgba(255, 97, 51, .6);
          }
        }
        .btn-get {
          background-color: #FF6133;;
          border: 1px solid #FF6133;
        }
      }
      .totalFundsPoolTable {
        background: rgba(255, 132, 83, 0.8);
        border: 2px solid #FFA579;
      }
    }
  }

  @media screen and (max-width: 1023px) {
    .stage-content {
      .step {
        font-size: 18px;
        height: 44px;
        line-height: 44px;
      }
      .total {
        flex-direction: column;
        .total-funds {
          text-align: center !important;
          padding-left: 0 !important;
          .btn-get {
            height: 40px;
            padding: 0 !important;
          }
        }
        .stage-info-left {
          padding: 0 20px;
          justify-content: center;
        }
        .totalFundsPoolTable {
          margin: 20px !important;
          .flex {
            padding: 30px 0;
            .item {
              .top {
                padding: 0 0 15px 0
              }
            }
          }
        }
      }
    }
    .stage-kio-content, .stage-kis-content {
      background-repeat: repeat;
    }
  }

  @media (min-width: 1024px) and (max-width: 1200px) {
    .stage-content {
      .stage1 {
        padding: 0 30px;
      }
      .stage-info-left {
        padding-right: 40px;
      }
      .totalFundsPoolTable {
        height: 240px !important;
      }
    }
  }

  @media screen and (min-width: 1200px) {
    .stage-content {
      background-repeat: no-repeat;
      .stage1 {
        width: 1300px;
      }
      .stage-info-left {
        padding-right: 40px;
      }
      .totalFundsPoolTable {
        height: 240px !important;
      }
    }
  }
</style>
